window.onload=function () {

    //全选和全不选
    var oAllelection=document.getElementById('allelection');
    var aBtn=oAllelection.getElementsByTagName('button');
    var aCheckbox=document.getElementsByClassName('cube');

    //编辑弹框
    var aDetails=document.getElementsByClassName('details');
    var aCover=document.getElementById('Cover');
    var aDelete=document.querySelector('.delete');



    //添加
    var oAddto=document.getElementById('addto');
    var oCover2=document.getElementById('Cover2');
    var oDelete2=document.querySelector('.delete2');
    var oAbb=document.querySelector('abb');

    //修改
    var aRev=document.getElementsByClassName('rev');
    var oCover3=document.getElementById('Cover3');
    var oDelete3=document.querySelector('.delete3');
    var oOlk=document.querySelector('olk');


    //1.编辑弹框
    //点击叉
    aDelete.onclick=function () {
        aCover.style.display='none'

    };
    //点击编辑按钮
    for(var i=0;i<aDetails.length;i++){
        aDetails[i].onclick=function(){
            aCover.style.display='block'
        };
    }

    //2.全选
    aBtn[0].onclick=function () {
        for(var i=0;i<aCheckbox.length;i++){
            aCheckbox[i].checked=true;
        }
    };

    //全不选
    aBtn[1].onclick=function () {
        for(var i=0;i<aCheckbox.length;i++){
            aCheckbox[i].checked=false;
        }
    };

    //3.添加
    //添加弹框
    //点击叉
    oDelete2.onclick=function () {
        oCover2.style.display='none'

    };
    //点击编辑按钮

    oAddto.onclick=function(){
        oCover2.style.display='block'
    };

};



